package com.blog.blog.service.oss.impl;

import com.blog.blog.mapper.OssFileMapper;
import com.blog.blog.service.oss.OssTrackingService;
import org.springframework.stereotype.Service;

@Service
public class OssTrackingServiceImpl implements OssTrackingService {
    private final OssFileMapper ossFileMapper;

    public OssTrackingServiceImpl(OssFileMapper ossFileMapper) {
        this.ossFileMapper = ossFileMapper;
    }

    @Override
    public void markUsedByUrl(String url) {
        if (url == null || url.isBlank()) return;
        ossFileMapper.markUsedByUrl(url);
    }

    @Override
    public void markUnusedByUrl(String url) {
        if (url == null || url.isBlank()) return;
        ossFileMapper.markUnusedByUrl(url);
    }
}


